package com.ruoyi.fly.mapper;

import com.ruoyi.fly.domain.AllOrder;
import com.ruoyi.fly.domain.AppletProductOrder;
import com.ruoyi.fly.domain.IncomeView;
import com.ruoyi.fly.domain.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Repository
public interface AppletProductOrderMapper {


    /**
     * 根据id查询订单
     * @param id
     * @return
     */
    AppletProductOrder selectAppletProductOrderById(String id);

    /**
     * 根据id查询订单
     * @return
     */
    //BigDecimal getOrderIncome(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("orderType")Integer orderType);

    /**
     * 查询产品和服务订单列表
     * @param allOrderVo
     * @return
     */
    List<AllOrder> selectAppletProductServerOrderList(AllOrderVo allOrderVo);

    /**
     * 查询订单列表
     * @param appletProductOrder
     * @return
     */
    List<ProductOrderVo> selectAppletProductOrderList(AppletProductOrderSearchVo appletProductOrder);

//    /**
//     * 根据条件查询订单
//     * @param productOrderQueryVo
//     * @return
//     */
//    AppletProductOrder selectAppletProductOrder(AppletProductOrderSearchVo productOrderQueryVo);


//    int insertAppletProductOrder(AppletProductOrder appletProductOrder);

    AllOrder selectAllOrderByOrderCode(String orderCode);

    /**
     * 添加快递单号
     * @param appletProductOrderVo
     * @return
     */
    int updateAppletProductOrder(AppletProductOrderVo appletProductOrderVo);

    /**
     * 删除订单
     * @param id
     * @return
     */
    int deleteAppletProductOrderById(String id);

    /**
     * 批量删除订单
     * @param ids
     * @return
     */
    int deleteAppletProductOrderByIds(String[] ids);

    /**
     * 获取订单总收入
     * @return
     */
    BigDecimal selectOrderSum(OrderVo orderVo);

    /**
     * 获取今日收入
     * @return
     */
    List<Map<String, Object>> selectTodayIncome(OrderVo orderVo);

    BigDecimal selectByTodayIncome();

    /**
     * 店铺总收入
     * @return
     */
    List<Map<String, Object>> selectStoreIncome(OrderVo orderVo);

    /**
     * 每个店铺今日收入
     * @param storeId
     * @return
     */
    List<Map<String, Object>> selectStoreTodayIncome(@Param("storeId") String storeId,@Param("orderVo") OrderVo orderVo);

    /**
     * 车辆总收入
     * @return
     */
    List<Map<String, Object>> selectLicenseIncome(OrderVo orderVo);

    /**
     * 每个车辆今日收入
     * @param vehiclesId
     * @return
     */
    List<Map<String, Object>> selectLicenseTodayIncome(@Param("vehiclesId") String vehiclesId,@Param("orderVo")OrderVo orderVo);


    BigDecimal selectAgentStoreByTodayIncome(String storeId);

    List<Map<String, Object>> selectAgentStoreTodayIncome(@Param("storeId") String storeId,@Param("orderVo")OrderVo orderVo);

    BigDecimal selectAgentLicenseByTodayIncome(String vehiclesId);

    List<Map<String, Object>> selectAgentLicenseTodayIncome(@Param("vehiclesId") String vehiclesId,@Param("orderVo")OrderVo orderVo);



}
